package com.good.shopping.product.feign;

import com.good.common.base.ServiceConstant;
import com.good.common.to.SkuReductionTo;
import com.good.common.to.SpuBoundTo;
import com.good.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Feign 接口 ：远程调用
 * @author shengren.yan
 * @create 2022-02-14
 */
@FeignClient(value = ServiceConstant.SERVICE_COUPON_NAME)
public interface CouponFeignService {

    String API_PREFIX = "/coupon";

    /**
     *
     *   (@RequestBody SpuBoundsEntity spuBounds); 将请求体的json转为SpuBoundsEntity
     *     只要json数据模型是兼容的。双方服务无需使用同一个to
     * @param spuBoundTo
     * @return
     */
    @RequestMapping(API_PREFIX + "/spubounds/save")
    public R saveSpuBounds(@RequestBody SpuBoundTo spuBoundTo);

    @PostMapping(API_PREFIX + "/skufullreduction/saveinfo")
    R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);


}
